package com.ete.service.manager.log

import com.ete.service.entry.log.AppLogEntry
import com.ete.service.service.log.UploadLogUtil
import java.io.File

/**
 * Author:LiXian
 * <p>
 * Desc:APP生成压缩包（zip）上报日志
 * Version:1.0
 * date 2024/1/18 11:22
 */
object LogManager {

    const val TAG = "UploadLogManager"

    /**
     * 初始化
     */
    @JvmStatic
    fun init(mZipEntry: AppLogEntry) {
        UploadLogUtil.init(mZipEntry)
    }

    /**
     * 删除App日志压缩文件
     *
     * @param isToastDelete 是否删除提醒
     */
    @JvmStatic
    @JvmOverloads
    fun deleteAppZipLogFile(isToastDelete: Boolean = false) {
        UploadLogUtil.deleteAppZipLogFile(isToastDelete)
    }

    /**
     * 是否有App日志压缩包
     */
    @JvmStatic
    fun isHadAppZipLogFile(): Boolean {
        return UploadLogUtil.isHadAppZipLogFile()
    }

    /**
     * 获取App日志压缩包
     */
    @JvmStatic
    fun getAppZipLogFile(): File? {
        return UploadLogUtil.getAppZipLogFile()
    }

    /**
     * App日志文件上传
     */
    @JvmStatic
    fun uploadAppLogFile() {
        UploadLogUtil.uploadAppLogFile(false)
    }

    /**
     * 选择目录上传日志
     */
    @JvmStatic
    fun chooseDirUploadAppLog() {
        UploadLogUtil.uploadAppLogFile(true)
    }

    /**
     * 取消日志文件上传
     */
    @JvmStatic
    fun cancelLogTask() {
        UploadLogUtil.cancelLogTask()
    }

    /**
     * 上传系统日志
     */
    fun uploadSystemLog() {
        UploadLogUtil.uploadSystemLog()
    }
}